package com.bw.login.model

import com.bw.common.entity.BaseRes
import com.bw.common.entity.UserEntity
import com.bw.db.room.RoomDBUtils
import com.bw.login.api.LoginApiServer
import javax.inject.Inject

class LoginRepository @Inject constructor(private val apiServer: LoginApiServer) {
    private val userDao = RoomDBUtils.getDataBase().getUserInfoDao()


    suspend fun loginToServer(userName: String, password: String): BaseRes<UserEntity> =
        apiServer.loginToServer(userName, password)

    suspend fun registerToServer(userName: String, password: String): BaseRes<UserEntity> =
        apiServer.registerToServer(userName, password)

}